#include <cstdio>

int main( )
{
    int a, b;
    double t;
    while ( scanf("%d%d%lf", &a, &b, &t) )
    {
        if ( a == 0 && b == 0 && t == 0 ) break;
        printf("%d\n", a - 1);
    }
}
